<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhKnowledgeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_knowledge', function (Blueprint $table) {
            $table->id();
            $table->integer('qlId', false, true)->comment('题库ID');
            $table->integer('courseId', false, true)->comment('学科ID');
            $table->integer('parentId', false, true)->nullable()->comment('父级ID');
            $table->tinyInteger('level')->default(1)->comment('级别：1:一级, 2:二级');
            $table->string('name')->comment('知识点名称');
            $table->tinyInteger('kaoshiMode')->nullable(2)->comment('是否是考试模式；1：是，2：否');
            $table->tinyInteger('kaoshiSeconds')->nullable(0)->comment('考试时间(秒)');
            $table->tinyInteger('kaoshiScore')->nullable(0)->comment('考试分值');
            $table->integer('questionCount')->nullable()->default(0)->comment('试题数量');
            $table->integer('sort')->nullable()->default(0)->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_knowledge');
    }
}
